home *** CD-ROM | disk | FTP | other *** search
- Path: informatik.tu-muenchen.de!meisenec
- From: meisenec@informatik.tu-muenchen.de (Robert Meisenecker)
- Newsgroups: comp.lang.c++
- Subject: Question on template-probs
- Date: 28 Mar 1996 19:10:48 GMT
- Organization: Technische Universitaet Muenchen, Germany
- Distribution: world
- Message-ID: <4jeo7o$q00@sunsystem5.informatik.tu-muenchen.de>
- NNTP-Posting-Host: hphalle0a.informatik.tu-muenchen.de
- Originator: meisenec@hphalle0a.informatik.tu-muenchen.de
-
-
- Hi,
-
- im an relatively unexperienced C++ programmer, which is the reason for this
- simple question (I bet it's simple for an more experienced programmer): i played
- around with templates and was confronted with the following problem:
-
- If I use the template by creating an object of a simple type like int, the linker
- states that all of the member functions of the template are unknown. This occurs
- only when the member functions are NOT coded inline. If the member functions are
- specified inline, then there is no problem with the linker. (Inline means here
- that the problem even occurs when the member functions are not specified as
- part of the class declaration, but in a source file with the leading keyword
- "inline")
-
- My question is: how to avoid those linker problems without declaring all
- member functions as part of the class (becomes a bit confusing when the member
- fuctions are a bit longer...)
-
- At first (as an experienced C-Programmer) I thougt of declaring Prototypes,
- but as I found out C++ allows only exactly one prototype, and by the way: Isn't
- it the job of the compiler to create those prototypes if I create a template?
-
- Maybe it's a special problem of my compiler: i'm working with the Watcom C/C++
- Compiler V.10.5.
-
- I'd be glad if anyone could solve my problem.
-
- Answers via PM to: meisenec@informatik.tu-muenchen.de
-
- Thanks
-
- Robert
-
-